﻿@model LeadMaster.ViewModels.ViewModelPurchaseOrders

<div class="spacer"></div>
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset style="left: 20px">
        <legend>Create Purchase Order</legend>

        @Html.HiddenFor(m => m.Lead.LeadID)
        @Html.HiddenFor(m => m.LeadID)
        @Html.HiddenFor(m => m.Survey.SurveyID)
        @Html.HiddenFor(m => m.Lead.TotalWeeks)

        <div class="editor-label">
            @Html.LabelFor(model => model.PurchaseOrder.CallCentre)
        </div>
        <div class="editor-field">
            @Html.DropDownList("CallCentreID", null, new { style = "width:300px;", @class = "chosen" })
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Survey.Ref)
        </div>
        <div class="editor-field">
            @Html.DropDownList("SurveyID", null, new { style = "width:300px;", @class = "chosen" })
            @Html.ValidationMessageFor(model => model.Survey.SurveyID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PurchaseOrder.WeekBeginning)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.PurchaseOrder.WeekBeginning, new { @class = "podates" })
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PurchaseOrder.WeekEnding)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.PurchaseOrder.WeekEnding, new { @class = "podates" })
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PurchaseOrder.Quantity)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PurchaseOrder.Quantity)
            @Html.ValidationMessageFor(model => model.PurchaseOrder.Quantity)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PurchaseOrder.Cap)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PurchaseOrder.Cap)
            @Html.ValidationMessageFor(model => model.PurchaseOrder.Cap)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PurchaseOrder.Visible)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PurchaseOrder.Visible)
            @Html.ValidationMessageFor(model => model.PurchaseOrder.Visible)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PurchaseOrder.ClientPaid)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PurchaseOrder.ClientPaid)
            @Html.ValidationMessageFor(model => model.PurchaseOrder.ClientPaid)
        </div>

        <div class="spacer"></div>
        <p>
        <input type="submit" value="Create Purchase Order" />
        </p>
    </fieldset>
}

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

<script type="text/javascript">
    $(document).ready(function () {

        $(".chosen").chosen();

        $(".podates").datepicker({
            changeMonth: true,
            changeYear: true,
            regional: 'en-GB',
            dateFormat: 'dd/mm/yy'
        });

    });
</script>
